//响应体常数
import httpStatusCodes from "@src/declarations/major/HttpStatusCodes";
import HttpStatusCodes from "@src/declarations/major/HttpStatusCodes";

const obj = {
  // 成功
  DEFAULT_SUCCESS: {
    code: httpStatusCodes.OK,
    msg: "",
  },
  // 缺乏参数
  LACK: {
    code: HttpStatusCodes.BAD_REQUEST,
    msg: "缺乏参数",
  },
  // token过期或者失效
  TOKEN_ERROR: {
    code: HttpStatusCodes.UNAUTHORIZED,
    msg: "token不存在或者过期",
  },
  // 登录错误
  LOGIN_ERROR: {
    code: httpStatusCodes.FORBIDDEN,
    msg: "用户名账号或者密码错误",
  },
  //添加数据
  ADD_DEFAULT_SUCCESS: {
    code: httpStatusCodes.CREATED,
    msg: "添加成功",
  },
  //新建用户名重复
  ADD_ERROR: {
    code: httpStatusCodes.BAD_REQUEST,
    msg: "名称不能重复",
  },
  //系统错误
  SERVER_ERROR: {
    code: httpStatusCodes.INTERNAL_SERVER_ERROR,
    msg: "系统错误",
  },
  // 用户名参数问题
  USERNAME_PARAMS_ERROR: {
    code: httpStatusCodes.BAD_REQUEST,
    msg: "用户名无效",
  },
  // 权限参数问题
  JURISDICTIONS_PARAMS_ERROR: {
    code: httpStatusCodes.BAD_REQUEST,
    msg: "权限不能为空",
  },
  // 字典分类数据不存在
  CATEGORY_ERROR: {
    code: httpStatusCodes.BAD_REQUEST,
    msg: "数据字典分类不存在",
  },
  // 文件找不到
  FILE_ERROR: {
    code: httpStatusCodes.BAD_REQUEST,
    msg: "文件只能一个个上传",
  },
  // 大小问题
  FILE_SIZE_ERROR: {
    code: httpStatusCodes.BAD_REQUEST,
    msg: "图片大小只能在2m以内",
  },

  // 接口本身问题
  FILE_API_ERROR: {
    code: httpStatusCodes.INTERNAL_SERVER_ERROR,
    msg: "api接口问题",
  },
  //文件类型错误
  FILE_TYPE_ERROR: {
    code: httpStatusCodes.BAD_REQUEST,
    msg: "只支持上传pdf、图片以及音频视频文件",
  },

  // 文件不存在
  FILE_ID_ERROR: {
    code: httpStatusCodes.BAD_REQUEST,
    msg: "上传的文件不存在",
  },

  LITERATURE_NOT_ERROR: {
    code: httpStatusCodes.BAD_REQUEST,
    msg: "文献数据不存在",
  },

  ARTICLE_NOT_ERROR: {
    code: httpStatusCodes.BAD_REQUEST,
    msg: "文章数据不存在",
  },
  PARAMETER_NOT_ARR: {
    code: httpStatusCodes.BAD_REQUEST,
    msg: "参数必须是数组",
  },

  REGION_NOT_ERROR:{
    code:httpStatusCodes.BAD_REQUEST,
    msg:"不存在该区域"
  }
};

export default obj;